<template>
    <div>
        <Table border :columns="columns" :data="data">
            <template #state="{ row }">
                <strong>{{stateArr.find(x => x.value == row.state).label}}</strong>
            </template>
        </Table>
        <Page style="float: right;margin-top: 10px;" :total="total" show-sizer />
    </div>
</template>

<script>
import { getOrderPayList } from "@/api/writer/index";
export default {
    name: "IncomeDetails",
    data() {
        return {
            columns: [
                {
                    title: '编号',
                    width: 70,
                    align: 'center',
                    key: 'id'
                },
                {
                    title: '订单号',
                    align: 'center',
                    key: 'orderNumber'
                },
                {
                    title: '需求名称',
                    align: 'center',
                    key: 'title'
                },
                {
                    title: '付款金额',
                    align: 'center',
                    key: 'price'
                },
                {
                    title: '订单状态',
                    align: 'center',
                    slot: 'state'
                }
            ],
            stateArr: [
                {
                    label: "待分配",
                    value: 0,
                },
                {
                    label: "客服接单",
                    value: 10,
                },
                {
                    label: "重新审核",
                    value: 11,
                },
                {
                    label: "审核驳回",
                    value: 15,
                },
                {
                    label: "审核通过",
                    value: 20,
                },
                {
                    label: "待付款",
                    value: 30,
                },
                {
                    label: "待分配",
                    value: 40,
                },
                {
                    label: "进行中",
                    value: 50,
                },
                {
                    label: "待验收",
                    value: 60,
                },
                {
                    label: "用户驳回",
                    value: 65,
                },
                {
                    label: "已验收",
                    value: 70,
                },
                {
                    label: "待评价",
                    value: 80,
                },
                {
                    label: "已评价",
                    value: 85,
                },
                {
                    label: "售后订单",
                    value: 90,
                },
                {
                    label: "已完成",
                    value: 99,
                },
            ],// 订单状态
            data: [],
            total: 100,
            params: {
                pageNum: 1,
                pageSize: 10
            }
        }
    },
    methods: {
        GetOrderPayList() {
            getOrderPayList(this.params).then(res => {
                if (res.code == 200) {
                    this.data = res.data.records;
                    this.total = res.data.total;
                    this.params.pageNum = res.data.pages;
                    this.params.pageSize = res.data.size;
                }
            })
        },
    },
    mounted() {
        this.GetOrderPayList()
    },
    components: {

    },
};
</script>

<style scoped lang="scss">
.add-box {
    margin: 40px 0;
}

.rate-demo {
    display: flex;
    justify-content: space-between;
    align-items: center;
}
</style>